package com.daon.pojo;

import lombok.Builder;
import lombok.ToString;

import java.util.Date;

@Builder
@ToString
public class SysNode {
    private Integer nodeId;

    private Integer nodePid;

    private Integer nodeTopPid;

    private String nodeName;

    private String nodeUrl;

    public String getNodeUrl() {
        return nodeUrl;
    }

    public void setNodeUrl(String nodeUrl) {
        this.nodeUrl = nodeUrl;
    }

    private String nodeIcon;

    private Integer nodeSort;

    private Integer nodeType;

    private String nodeDesc;

    private Date createdAt;

    private Date updatedAt;

    public SysNode(Integer nodeId, Integer nodePid, Integer nodeTopPid, String nodeName, String nodeUrl, String nodeIcon, Integer nodeSort, Integer nodeType, String nodeDesc, Date createdAt, Date updatedAt) {
        this.nodeId = nodeId;
        this.nodePid = nodePid;
        this.nodeTopPid = nodeTopPid;
        this.nodeName = nodeName;
        this.nodeUrl = nodeUrl;
        this.nodeIcon = nodeIcon;
        this.nodeSort = nodeSort;
        this.nodeType = nodeType;
        this.nodeDesc = nodeDesc;
        this.createdAt = createdAt;
        this.updatedAt = updatedAt;
    }

    public SysNode() {
        super();
    }

    public Integer getNodeId() {
        return nodeId;
    }

    public void setNodeId(Integer nodeId) {
        this.nodeId = nodeId;
    }

    public Integer getNodePid() {
        return nodePid;
    }

    public void setNodePid(Integer nodePid) {
        this.nodePid = nodePid;
    }

    public Integer getNodeTopPid() {
        return nodeTopPid;
    }

    public void setNodeTopPid(Integer nodeTopPid) {
        this.nodeTopPid = nodeTopPid;
    }

    public String getNodeName() {
        return nodeName;
    }

    public void setNodeName(String nodeName) {
        this.nodeName = nodeName == null ? null : nodeName.trim();
    }

    public String getNodeIcon() {
        return nodeIcon;
    }

    public void setNodeIcon(String nodeIcon) {
        this.nodeIcon = nodeIcon == null ? null : nodeIcon.trim();
    }

    public Integer getNodeSort() {
        return nodeSort;
    }

    public void setNodeSort(Integer nodeSort) {
        this.nodeSort = nodeSort;
    }

    public Integer getNodeType() {
        return nodeType;
    }

    public void setNodeType(Integer nodeType) {
        this.nodeType = nodeType;
    }

    public String getNodeDesc() {
        return nodeDesc;
    }

    public void setNodeDesc(String nodeDesc) {
        this.nodeDesc = nodeDesc == null ? null : nodeDesc.trim();
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public Date getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }

    public String getNodeTypeName(){
        String nodeTypeName = "菜单";
        switch (nodeType){
            case 1:
                nodeTypeName = "菜单";
                break;
            case 2:
                nodeTypeName = "菜单与权限控制";
                break;
            case 3:
                nodeTypeName = "权限控制";
                break;
        }
        return nodeTypeName;
    }
}